package model.effects;

import model.entity.Entity;

public class Heal extends Effect{
	private int baseValue;
	
	public Heal(int baseValue){
		this.baseValue = baseValue;
	}
	@Override
	public void modifyParameter(double modification) {
		double temp = modification * baseValue;
		baseValue = (int) temp;		
	}

	@Override
	public void doEffect(Entity e) {
		e.heal(baseValue);		
	}
	
	@Override
	public String toString(double factor) {
		factor = Math.random() < .5 ? factor * -1 : factor;
		int newValue = (int)factor + this.baseValue;
		
		return "was healed for " + newValue + " health.";
	}
}
